package com.vitabuybuy.tv.network

import android.nfc.cardemulation.HostApduService
import com.library.common.net.NetUrl
import com.vitabuybuy.tv.dto.*


import rxhttp.IAwait
import rxhttp.wrapper.param.RxHttp
import rxhttp.wrapper.param.toResponse

/**
 * 作者：SimGa
 * 日期：2020/12/3
 * 时间：17:04
 * 包名：com.vitabuybuy.tv.network
 */
object HomeRepository {
    fun getLiveList(
        params: HashMap<String, Any>
    ): IAwait<MutableList<LiveListDto>> {
        return RxHttp.postJson(NetUrl.api_home_live_list)
            .addAll(params).toResponse()
    }

    fun getHomeGoodList(params: HashMap<String, Any>): IAwait<List<GoodsDto>> {
        return RxHttp.postJson(NetUrl.api_home_shop_goods)
            .addAll(params).toResponse()
    }

    fun getGroupGoodsList(params: HashMap<String, Any>): IAwait<List<GroupBuyListDto>> {
        return RxHttp.postJson(NetUrl.api_find_groupbuy_list)
            .addAll(params).toResponse()
    }

    fun getBiddingGoodsList(params: HashMap<String, Any>): IAwait<List<BiddingListDto>> {
        return RxHttp.postJson(NetUrl.api_find_bidding_list)
            .addAll(params).toResponse()
    }

    fun getBannerList(): IAwait<BannerDto> {
        return RxHttp.postJson(NetUrl.api_banner)
            .add("location", "首页banner图").toResponse()
    }
}